node.getPackageName()

require 'import'
import 'com.androlua.*'
p1= 300
p2= 1000
p3= 1000

local cxcx={{"<#com.cxinventor.file.explorer:id/bottom_menu_copy"}}
local clubHouse= {{"<#com.clubhouse.app:id/alertTitle"}}
local Telegram= {{'<الذهاب إلى الرسالة'}, {'<تثبيت في الأعلى'}, {'<كتم'}, {'<إلغاء الكتم'}, {'<Désactiver notifications'}, {'<Activer notifications'}, {'<Go to message'}, {'<Pin to top'}, {'<Mute'}, {'<Aller au message'}, {'<Épingler'}, {'<Activer la sourdine'}, {'<نسخ|Copy|Copier'}}
local Messenger= {{'<رد'}, {'<أرشفة'}, {'<لوحة تحتوي على قائمة التفاعلات التي يمكنك استخدامها للتفاعل مع هذه الرسالة.'}, {'<إزالة'}, {'<Reply'}, {'<Archive'}, {'<Répondre'}, {'<Archiver'}}
local Facebook= {{'<أعجبني@فيسبوك'}, {'<نسخ النص@فيسبوك'}, {'<Like@Facebook'}, {'<Copy text@Facebook'}, {'<J’aime@Facebook'}, {'<Copier le texte@Facebook'}, {'<إزالة هذا الإشعار|Supprimer cette notification|Remove this notification|حذف التعليق|Supprimer le commentaire|Delete Comment|Like|أعجبني'}}
local OneUI= {{'<تحديد العناصر'}, {'<Select items'}, {'<Sélectionner des éléments'}, {'<#com.sec.android.app.launcher:id/quickoption_app_info'}, {'<#com.sec.android.app.launcher:id/global_option_item'}}
local Chrome= {{'<#com.android.chrome:id/menu_row_text#1'}, {'<نسخ@Chrome'}, {'<Copy'}, {'<Copier@Chrome'}, {'<#com.google.android.apps.messaging:id/action_pin_to_top'}, {"<‏الرّد|Reply"}}
local Viber= {{'<#com.viber.voip:id/btn_delete'}, {'<#org.thoughtcrime.securesms:id/action_info'}, {'<#org.thoughtcrime.securesms:id/menu_pin_selected'}, {'<#org.thoughtcrime.securesms:id/menu_context_delete_message'}, {'<#name_text#1@Zello'}, {'<#text#1@imo'}}
local Truecaller= {{'<#com.truecaller:id/action_reply'}, {'<#com.truecaller:id/action_mode_close_button'}}
local Files= {{"<#com.google.android.apps.nbu.files:id/action_mode_close_button", }, {'<#com.sec.android.app.myfiles:id/menu_share#1'}, {'<#com.sec.android.app.myfiles:id/menu_move'}, {'<#com.sec.android.app.myfiles:id/icon_menu_1st'}, {'<#com.sec.android.app.myfiles:id/menu_delete'}, {'<#com.google.android.apps.nbu.files:id/share_action'}, {'<#com.google.android.apps.nbu.files:id/delete_action'}, {'<#com.android.documentsui:id/editorview_cancel'}, {"<#com.google.android.apps.nbu.files:id/action_mode_close_button", }}
local PlayStore= {{'<#com.android.vending:id/0_resource_name_obfuscated>20'}, {'<#com.miui.fm:id/tv_menu_edit>10'}}
local Contacts= {{'<#com.google.android.contacts:id/menu_share'}, {'<#com.samsung.android.app.contacts:id/menu_contact_list_send_message'}, {'<#com.samsung.android.contacts:id/menu_share_via'}, {'<#com.samsung.android.contacts:id/menu_share_via'}}
local Duo= {{'<#com.google.android.apps.tachyon:id/contact_action_container_video_call'}, {'<#android:id/text1#1'}, {'<#com.google.android.apps.photos:id/share_button'}, {'<#android:id/text1#1'}, {'<#com.ahmed53.quraan:id/sora_makan#-1'}}
local Drive= {{'<#com.google.android.apps.docs:id/menu_multiselect_move'}, {'<#com.google.android.apps.docs:id/menu_multiselect_trash'}, {'<#com.ruet_cse_1003050.ragib.appbackup.pro:id/action_mode_close_button'}, {'<#com.farmerbb.notepad:id/action_bar_title'}}
local FilesManager= {{'<#com.huawei.hidisk:id/menu_copy_button'}, {'<#com.huawei.hidisk:id/menu_delete_button'}, {'<#com.mi.android.globalFileexplorer:id/action_send'}, {'<#com.alphainventor.filemanager:id/bottom_menu_copy'}, {'<#com.coloros.filemanager:id/navigation_send'}, {'<#com.coloros.filemanager:id/action_select_all'}, {'<#com.oneplus.filemanager:id/actionbar_selectall'}}
local OppoLauncher= {{'<#com.oppo.launcher:id/bubble_text'}, {'<#com.mi.android.globallauncher:id/deep_shortcuts_container'}, {'<#com.oppo.launcher:id/bubble_text#1'}}
local MxPlayer= {{'<#com.mxtech.videoplayer.pro:id/all'}, {'<#com.hiqrecorder.full:id/menuPlay'}}
local NovaLauncher= {{'<#com.teslacoilsw.launcher:id/deep_shortcuts_container'}, {'<#com.transsion.XOSLauncher:id/hx'}}
local WhatsApp= {{'<#menuitem_conversations_unpin'}, {'<#menuitem_conversations_pin'}, {'<#menuitem_reply'}, {'<#message_text'}, {'<#menuitem_delete'}, {'<#alertTitle'}, {'<#menuitem_label>5'}}
local Gmail= {{'<#com.google.android.gm:id/archive'}}
local MyUi= {{'<#com.miui.home:id/btnOk'}}
local Phone= {{'<#com.google.android.dialer:id/new_call_log_popup_menu_header'}, {'<#com.samsung.android.dialer:id/menu_delete'}}
local Messages= {{'<#com.google.android.apps.messaging:id/action_pin_to_top'}, {'<#com.google.android.apps.messaging:id/copy_text'}, {'<#com.samsung.android.messaging:id/noti'}, {'<#com.android.mms:id/setting_menu'}, {'<#com.android.mms:id/search_text'}}
local KeepNotes= {{'<#com.google.android.keep:id/menu_pin'}}
local OnePlusLauncher= {{'<#net.oneplus.launcher:id/shortcuts_view_title'}, {'<#com.android.systemui:id/menu_item_lock'}}
local ch= node.getContentDescription()
local ch2= node.isLongClickable()
local ch3= node.getClassName()
local applicationName= node.getPackageName()
local id= node.getViewIdResourceName()
local text= this.getText(node)
if applicationName == 'com.arabcast.almanarah' then
service.click{(
{'#com.arabcast.almanarah:id/bookmarkTV'} )}
elseif (applicationName == 'com.whatsapp' or applicationName == 'com.whatsapp4b' or applicationName == 'com.gbwhatsapp') and (id == 'com.whatsapp:id/control_btn' or id == 'com.gbwhatsapp:id/control_btn' or id == 'com.whatsapp4b:id/control_btn' ) then 
service.execute('[点击]', node)


elseif (applicationName == 'com.whatsapp' or applicationName == 'com.whatsapp.w4b' or applicationName == 'com.gbwhatsapp') and (text:match("‏قراءة المزيد") or text:match('Voir plus') or text:match('Read more')) then


require "import"
"android.app.*"
import "com.androlua.*"
import "android.os.*"
import "android.widget.*"
import "android.view.*"
import "java.io.*"
import "java.util.*"
import "android.content.*"
local l= Locale.getDefault().getLanguage()
if l == "ar"
title= " قراءة المزيد  "
  btn= " غلق النافذة "
  btn2= " نسخ النص الى الحافظة"
  btn3= " مشاركة النص"
 elseif l == "en"
  title= " the full text"
  btn= " Close "
  btn2= " Copy to clipboard "
  btn3= "share the text "
elseif l == "fr"
  title= " Le text entier "
  btn= " Quiter "
  btn2= " Copier le text "
  btn3= " Partager le text "
end
local applicationName= node.getPackageName()
local appName= {"com.whatsapp", 'com.whatsapp.w4b', 'com.gbwhatsapp', }
local text2= {"‏قراءة المزيد|Voir plus|Read more", }
for i pairs (appName)
  if applicationName == appName[i] and this.findAccessibilityNodeInfo(text2[1])
    service.click({
    {"‏قراءة المزيد|Voir plus|Read more$0<500>50", }})
task(1, function()
local text= {service.getText(node)}
      dlg=LuaDialog(this)
dlg.setTitle(title)
dlg.View= loadlayout({
LinearLayout,
orientation= "vertical",
layout_wide= "60%w",
layout_height= "60%h",
background= "@Pink",

{
ListView,
id= "ls",
items= text,
};
})
      ls.adapter= (ArrayListAdapter(this, String(text[1]).split([[.
]])))
      dlg.Button= btn, nil
dlg.setButton2(btn2, function()
        this.copy(c[1])
      end)
      dlg.setButton3(btn3, function()
i= Intent(Intent.ACTION_SEND)
        .setType("*/*")
        .putExtra(Intent.EXTRA_TEXT, text[1])
this.startActivity(i)end)
dlg.show()
end)
  end
end
return true



elseif (applicationName == 'com.google.android.apps.nexuslauncher') or (applicationName == 'com.android.launcher3') then
--service.playSoundTick()
service.click({
{'%操作$50', 
'<#android:id/text1#1'}})
elseif (applicationName == 'org.telegram.messenger' or applicationName == 'org.telegram.plus') and (this.findAccessibilityNodeInfo('Go back|العودة للخلف|Retour')) and (ch3 == 'android.widget.SeekBar' or ch3 == 'android.view.ViewGroup') then
--service.playSoundTick()
service.click({
{'%操作$15', 
'#android:id/text1#1$500', 
'<رد|Repondre|Reply'}
})elseif service.execute('[长按]', node) 
this.setTTSEnabled(false)
task(p3, function()
--this.playSoundTick()
this.setTTSEnabled(true)


local appName= {'com.cxinventor.file.explorer', "com.clubhouse.app", 'com.abdo.quran', 'org.telegram.messenger', 'org.telegram.plus', 'com.facebook.orca', 'com.facebook.katana', 'com.android.chrome', 'com.twitter.android', 'com.loudtalks', 'com.imo.android.imoim', 'com.viber.voip', 'org.thoughtcrime.securesms',  'com.google.android.dialer', 'com.samsung.android.dialer', 'com.google.android.contacts', 'com.samsung.android.app.contacts', 'com.samsung.android.contacts', 'com.oneplus.contacts', 'com.android.documentsui', 'com.sec.android.app.myfiles', 'com.google.android.apps.nbu.files', 'com.google.android.apps.messaging', 'com.samsung.android.messaging', 'com.android.mms', 'com.oneplus.mms', 'com.truecaller',  'com.google.android.gm', 'com.miui.fm', 'com.android.vending', 'com.google.android.apps.docs', 'com.ruet_cse_1003050.ragib.appbackup.pro', 'com.farmerbb.notepad', 'com.google.android.apps.tachyon', 'com.google.android.apps.photos', 'com.nirenr.talkman', 'com.nirenr.talkman.geek', 'com.ahmed53.quraan', 'com.skype.raider', 'com.miui.home', 'com.sec.android.app.launcher', 'com.oppo.launcher', 'com.mi.android.globallauncher', 'net.oneplus.launcher', 'com.android.systemui', 'com.teslacoilsw.launcher', 'com.transsion.XOSLauncher', 'com.huawei.hidisk', 'com.mi.android.globalFileexplorer', 'com.alphainventor.filemanager', 'com.coloros.filemanager', 'com.oneplus.filemanager', 'com.google.android.keep', 'com.mxtech.videoplayer.pro', 'com.hiqrecorder.full', 'com.whatsapp', 'com.whatsapp.w4b', 'com.gbwhatsapp', 'com.WhatsApp2Plus', }
local nodeName= {cxcx, clubHouse, YouTube, Telegram, Telegram, Messenger, Facebook, Chrome, Chrome, Viber, Viber, Viber, Viber, Phone, Phone, Contacts, Contacts, Contacts, Contacts, Files, Files, Files, Messages, Messages, Messages, Messages, Truecaller, Gmail, PlayStore, PlayStore, Drive, Drive, Drive, Duo, Duo, Duo, Duo, Duo, Duo, MyUi, OneUI, OppoLauncher, OppoLauncher, OnePlusLauncher, OnePlusLauncher, NovaLauncher, NovaLauncher, FilesManager, FilesManager, FilesManager, FilesManager, FilesManager, KeepNotes, MxPlayer, MxPlayer, WhatsApp, WhatsApp, WhatsApp, WhatsApp}
for i in ipairs (appName, nodeName) do
if applicationName == appName[i] then
 service.click(nodeName[i]) 
--else return true, service.speak(' عذرا  هذا العنصر غير مدعوم حاليا . الرجاء الإتصال بفريق Jieshuo ')
end
end
end)
-- else
this.speak(' عذرا هذا العنصر غير مدعوم حاليا . الرجاء الإتصال بفريق Jieshuo for Arab') 

end
return true